/**
 * 递归树 根据 id 匹配数据
 * @param {*} treeList
 * @param {*} id
 */
export function findDataByIdInTree(treeList, id) {
  // console.log("findDataByIdInTree", id);
  for (let index = 0; index < treeList.length;index++) {
    const node = treeList[index];
    // console.log('node',node);
    if (node.id == id) return node;
    if (node.children) {
      const res = findDataByIdInTree(node.children,id);
      if (res) return res;
    }
  }
  return null;
}
